#macro(pagebar,$pname,$page)
<hr/>
<p class="pagebar">
    #set($pageCount=$!page.pages)
    #set($pageCurrent=$!page.current)
    #set($prePage=$!pageCurrent - 1)
    #set($nextPage=$!pageCurrent + 1)
    #set($next5Page=$!pageCurrent + 5)
    <a href="/system/management/${pname}-management.html?pageNo=$!prePage">‹‹</a>&nbsp;&nbsp;
    #if($pageCount == 0)
        <a href="/system/management/${pname}-management.html?pageNo=1">1</a>&nbsp;&nbsp;
    #elseif($pageCount < 10)
        #foreach($pageNO in [1..$pageCount])
        <a href="/system/management/${pname}-management.html?pageNo=$pageNO">$pageNO</a>&nbsp;&nbsp;
        #end
    #elseif($pageCurrent < 6)
        #foreach($pageNO in [1..10])
        <a href="/system/management/${pname}-management.html?pageNo=$pageNO">$pageNO</a>&nbsp;&nbsp;
        #end
    #elseif($pageCount < $next5Page)
        #set($tempStart = $pageCount - 9)
        #foreach($pageNO in [$tempStart..$pageCount])
        <a href="/system/management/${pname}-management.html?pageNo=$pageNO">$pageNO</a>&nbsp;&nbsp;
        #end
    #else
        #set($tempStart=$pageCurrent - 5)
        #set($tempEnd=$pageCurrent + 5)
        #foreach($pageNO in [$tempStart..$tempEnd])
        <a href="/system/management/${pname}-management.html?pageNo=$pageNO">$pageNO</a>&nbsp;&nbsp;
        #end
    #end
    <a href="/system/management/${pname}-management.html?pageNo=$!nextPage">››</a>&nbsp;&nbsp;
</p>
#end
